This message was deleted.
# general
s
This message was deleted.
a
You need to wrap the definition in db.address.apply(
as a promise
c
When you say "as a promise", do you mean using the apply function to make the dependent resource?
As in...
a
exactly
Actually its strange it didn't work for you by passing address directly, because environment accepts InputKeyValuePair[] and KeyValuePair itself is a part of Inputstring
@careful-engine-71229 according to these types, it should just work straight like this:
Copy code
const db = new Instance('web-server-db', {
        instanceClass: "db.t3.micro",
        allocatedStorage: 24,
        engine: "mysql",
        username: "web",
        password: password.result,
    });
    
    const phpContainerDefinition = makeFargateDefinition({
        name: 'web-server-php',
        image: `<http://232167344693.dkr.ecr.us-west-1.amazonaws.com/zingle/web-server/php:${cluster.code}|232167344693.dkr.ecr.us-west-1.amazonaws.com/zingle/web-server/php:${cluster.code}>`,
        environment: [{
            name: 'RDBMS_HOST',
            value: db.address,
        }]})
c
Maybe that an update?
My idea says it only accepts keyvalue pairs
where do you see that?
I think the problem is that the tast definition requires json for container definitions
so I'm having to construct a string with those values to pass to the task definition
Just a thought about this, it would be nice if like
apply
there was a
then
or even better would be a async function so that I could use
await
to ensure that the resource is created and primitives are available before handing off to a dependent service.